<!doctype html>
<html>

<head>
    <meta charset="UTF-8">
    <title>CDNBye JWPlayer Demo</title>
    <!-- CDNBye Plugin -->
    <script src="//cdn.jsdelivr.net/npm/cdnbye@latest"></script>
    <script src="//cdn.jsdelivr.net/gh/teranode/jw-provider@0.0.9/provider.hlsjs.js"></script>
<!--    <script src="//cdn.jsdelivr.net/npm/cdnbye@latest/dist/jwplayer.provider.hls.js"></script>-->
    <!-- JW Player Builds -->
    <script src="//ssl.p.jwpcdn.com/player/v/8.22.0/jwplayer.js"></script>

</head>

<body>
<header></header>
<center>
    <div id="demoplayer"></div>
</center>
<script>
    jwplayer.key = "uoW6qHjBL3KNudxKVnwa3rt5LlTakbko9e6aQ6VUyKQ=";

    jwplayer('demoplayer').setup({
        file: 'https://wowza.peer5.com/live/smil:bbb_abr.smil/chunklist_b591000.m3u8',
        width: 512,
        height: 288,
        autostart: true,
        hlsjsConfig: {
            // debug: true,
            // Other hlsjsConfig options provided by hls.js
            p2pConfig: {
                // logLevel: true,
                live: true,        // set to false in VOD mode
                // Other p2pConfig options provided by CDNBye
            }
        },
    });

    jwplayer().on('play', function () {
        jwplayer().hls.p2pEngine.on('stats', function ({totalHTTPDownloaded, totalP2PDownloaded}) {
            // get totalHTTPDownloaded and totalP2PDownloaded here
        })
    })

</script>
</body>

</html>
